#ifndef RSIM_ABADATASTRUCT_H
#define RSIM_ABADATASTRUCT_H

/* -------------------------------------------------------------------------- *
 * File: ABAData.h                                                            *
 * Authors: Kishor Bhalerao                                                   *
 * Email : kishor8dm@gmail.com                                                *
 * Contributors:                                                              *
 * Email:                                                                     *
 * copyright (c) 2010 Authors.                                                *
 *                                                                            *
 * This program is free software: you can redistribute it and/or modify it    *
 * under the terms of the GNU General Public License as published by the Free *
 * Software Foundation, either version 3 of the License, or any later version.*
 *                                                                            *
 * This program is distributed in the hope that it will be useful, but        *
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   *
 * for more details. (http://www.gnu.org/licenses/)                           *
 * -------------------------------------------------------------------------- */

#include "LinAlgDecl.h"

namespace RSIM{
	
class Joint;
class EOMData;

class ABAData{
	public:
		/** Sets all values to NULL */
		ABAData();
		
		/** This does nothing. All pointer values are set to NULL*/
		ABAData(const ABAData&);
		
		void initForwardDynamics(const Joint *J);
		
		/** Delete allocated space and set all pointers to NULL*/
		void clear();
		
		/** Delete allocated space */
		~ABAData();
		
		Mat6x6* wgetIk3();
		Vect6* wgetFk3();
		double* wgetH_ii();
		Vect6* wgetcFk();
		
		const Mat6x6* getIk3()const;
		const Vect6* getFk3()const;
		const Vect6* getcFk()const;
		const double* getH_ii()const;
	private:
		/** Articulated body inertia of this body expressed in F of this body*/
		Mat6x6 *Ik3_;
		
		/** Spatial bias force expressed in frame F of this body */
		Vect6 *Fk3_;		
		
		/** \check{F}^k = F^{k}_3 - I^{k}_3 A^{k-1}_t. Expressed in F of parent. */
		Vect6 *cFk_;
}; // class ABAData

inline Mat6x6* ABAData::wgetIk3(){return Ik3_;}
inline const Mat6x6* ABAData::getIk3()const{return Ik3_;}

inline Vect6* ABAData::wgetFk3(){return Fk3_;}
inline const Vect6* ABAData::getFk3()const {return Fk3_;}

inline Vect6* ABAData::wgetcFk(){return cFk_;}
inline const Vect6* ABAData::getcFk()const{return cFk_;}

} // namespace RSIM

#endif